package main

func cuttingRope(n int) int {
	var s = 1
	if n == 2 {
		return 1
	}
	if n == 3 {
		return 2
	}
	for n > 4 {
		n = n - 3
		s = s * 3
	}
	return s * n
}
